<%@page import="com.lagou.entity.Company"%>
<%@page import="com.lagou.biz.impl.CompanyBizImpl"%>
<%@page import="com.lagou.biz.CompanyBiz"%>
<%@page import="com.lagou.biz.impl.BusinessBizImpl"%>
<%@page import="com.lagou.biz.BusinessBiz"%>
<%@page import="java.net.URLDecoder"%>
<%@page import="com.lagou.entity.Business"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
        <base href="<%=basePath%>">
        <meta charset="UTF-8">
        <title>拉勾网-最专业的互联网招聘平台</title>
        <link href="style/images/favicon.ico" rel="Shortcut Icon"> <!--标签图标-->
        
         <link href="style/css/style.css" type="text/css" rel="stylesheet">
         <link href="style/css/external.min.css" type="text/css" rel="stylesheet">
         <link href="style/css/popup.css" type="text/css" rel="stylesheet">
         
         <script type="text/javascript" src="style/js/jquery.1.10.1.min.js"></script>
<!-- 获取cook -->
<%
	//0、打开界面先去获取session,如果session获取不到采取获取cookie
     Business user=(Business)session.getAttribute("business");
     if(user==null){
    	//1、登入界面打开先去获取cookie看看有没有决定显示的是什么内容
         String name ="";
         String pwd="";
         Cookie cookeis[]=request.getCookies();
         /* User user=null; */
         if(cookeis!=null){
      	   for(Cookie c:cookeis){
      		   if(c.getName().equals("business_login_name")){
      			 //中文处理解码器
         			name=URLDecoder.decode(c.getValue()); 
      		   }
      		   if(c.getName().equals("business_login_pwd")){
         			pwd=c.getValue();
         		}
      	   }
           //2、如果cookie中有数据，不能直接是登入成功，必须去数据库判断（目的是去数据库取账号密码比较唯一）
           if(!"".equals(name)&&!"".equals(pwd)){
        	    BusinessBiz biz = new BusinessBizImpl();
		Business business = biz.login(name, pwd);
        	    System.out.println(business);
                if(business!=null){
                    session.setAttribute("buser", business);
                }
           }/* for结束 */
         }
      } 
     session.setAttribute("buser", user);
%>
<!-- 获取cook结束 -->

	<!-- 开始 top -->
	<div id="header">
    	<div class="wrapper">
    		<a class="logo" href="index.jsp">
    			<img width="229" height="43" alt="拉勾招聘-专注互联网招聘" src="style/images/logo.png">
    		</a>
    		<!-------------------------------------->
	    	<c:if test="${buser != null}">
	    	<!-------------------------------------->
	    	<ul id="navheader" class="reset">
    			<li><a href="ToIndexServlet?aa=1">首页</a></li>
    			<li><a href="CompanyServlet?op=queryCompang&aa=1">公司</a></li>
    			<li><a target="论坛" href="ForumServlet?op=forum1&aa=1">论坛</a></li>
    			<c:if test="${Cstatus == 1}">
    		    <li ><a href="company_resume/newjob.jsp">发布新职位</a></li>
    		    <li ><a href="TogetcompanyServlet?edithomepage=1&cid=${cid}">公司主页</a></li>
    		     </c:if>
    		     <c:if test="${Cstatus == 0}">
    		    <li ><a href="companyac.jsp">发布新职位</a></li>
    		    <li ><a href="companyac.jsp">公司主页</a></li>
    		     </c:if>
    		     <c:if test="${Cstatus == 2}">
    		    <li ><a href="companyinformationone.jsp" onClick="return alert('审核不通过！请重新提交公司信息！');">发布新职位</a></li>
    		    <li ><a href="companyinformationone.jsp" onClick="return alert('审核不通过！请重新提交公司信息！');">公司主页</a></li>
    		     </c:if>
    		     <c:if test="${Cstatus == 3}">
    		    <li ><a href="companylincense.jsp" onClick="return alert('请先提交公司信息！');">发布新职位</a></li>
    		    <li ><a href="companylincense.jsp" onClick="return alert('请先提交公司信息！');">公司主页</a></li>
    		     </c:if>
	    	</ul>
	    	<!---下拉菜单--------------------->
	    	<dl class="collapsible_menu">
            	<dt>
           			<span>${buser.getBemail()} &nbsp;${cid}</span> 
            		<span class="red" id="noticeDot-0"></span>
            		<i></i>
            	</dt>
            	
                <dd><a href="TogetcompanyServlet?edithomepage=2&cid=${cid}" class="xiala">帐号设置</a></dd>
                <c:if test="${Cstatus == 1}">
                <dd><a href="TogetresumeServlet?pstatus1=0&page=0&cid=${cid}" class="xiala">我要招人</a></dd>
                <dd><a href="TogetcompanyServlet?edithomepage=0&cid=${cid}" class="xiala">编辑公司主页</a></dd>
                </c:if>
                <c:if test="${Cstatus == 0}">
                <dd><a href="companyac.jsp" class="xiala">我要招人</a></dd>
                <dd><a href="companyac.jsp" class="xiala">公司主页</a></dd>
                </c:if>
                 <c:if test="${Cstatus == 2}">
                <dd><a href="companyinformationone.jsp" class="xiala" onClick="return alert('审核不通过！请重新提交公司信息！');">我要招人</a></dd>
                <dd><a href="companyinformationone.jsp" class="xiala" onClick="return alert('审核不通过！请重新提交公司信息！');">公司主页</a></dd>
                </c:if>
                <c:if test="${Cstatus == 3}">
                <dd><a href="companylincense.jsp" class="xiala" onClick="return alert('请先提交公司信息！');">我要招人</a></dd>
                <dd><a href="companylincense.jsp" class="xiala" onClick="return alert('请先提交公司信息！');">编辑公司主页</a></dd>
                </c:if>
                <dd class="logout"><a rel="nofollow" href="DologeoutServlet"  class="xiala">退出</a></dd>
            </dl>
            
            <div id="noticeTip">
            	<span class="bot"></span>
				<span class="top"></span>
				<a  href="DoRefreshServlet?bid=${buser.getBid()}"><strong>点击刷新公司审核状态</strong></a>
				<a class="closeNT" href="javascript:;"></a>
            </div>
            
            <!-------------------------------------->
            </c:if>
            <c:if test="${buser == null}">
            <ul class="reset" id="navheader">
    			    <li><a href="ToIndexServlet">首页</a></li>
					<li><a href="CompanyServlet?op=queryCompang">公司</a></li>
					<li><a href="ForumServlet?op=forum1" target="_blank">论坛</a></li>
					<li><a href="ToListServlet" rel="nofollow">职位</a></li>
	    	</ul>
              <ul class="loginTop">
            	<li><a href="login.jsp" rel="nofollow">登录</a></li>
            	<li>|</li>
            	<li><a href="register.jsp" rel="nofollow">注册</a></li>
              </ul>
            </c:if>
        </div>
    </div>
        <script src="style/js/core.min.js" type="text/javascript"></script>
